#include <bits/stdc++.h>

using namespace std;
using ll = long long;
const int MAXN = 2e5 + 10;
const int MOD = 998244353;

int n, k, a[MAXN], b[MAXN];
int dp[MAXN][2];
int main() {
#ifdef LOCAL
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
    cin >> n >> k;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    for (int i = 1; i <= n; i++) {
        cin >> b[i];
    }

    dp[1][0] = 1;
    for (int i = 2; i <= n; i++) {
        if (dp[i - 1][0]) {
            if (abs(a[i] - a[i - 1]) <= k) dp[i][0] = 1;
            if (abs(b[i] - a[i - 1]) <= k) dp[i][1] = 1;
        }
        if (dp[i - 1][1]) {
            if (abs(a[i] - b[i - 1]) <= k) dp[i][0] = 1;
            if (abs(b[i] - b[i - 1]) <= k) dp[i][1] = 1;
        }
    }

    if (dp[n][0] || dp[n][1]) puts("Yes");
    else puts("No");

    return 0;
}